<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>网络新闻应急性管理系统</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="news,新闻,推送">
<meta http-equiv="description" content="nms">
	<link rel="stylesheet" type="text/css"
		href="/res/style/common.css" />
	<link rel="stylesheet" type="text/css"
		href="/res/style/index.css"/>
	<script type="text/javascript"
		src="/res/script/common.js"></script>
	<script type="text/javascript"
		src="/res/script/index.js"></script>
</head>

<body onload="ini();">

	<jsp:include page="/page/common/header.jsp" ></jsp:include>
	
	<div class="NewsTypeDiv">
		<table>
			<tr>
				<td>
					<a href="#">全部</a>
				</td>
				<c:forEach items="${ntContainer.newsType2}" var="t" varStatus="vStatus">
					<td>
						<a href="#">${t.content}</a>
					</td>
				</c:forEach>
				<c:forEach items="${ntContainer.newsType3}" var="t" varStatus="vStatus">
					<td>
						<a href="#">${t.content}</a>
					</td>
				</c:forEach>
			</tr>
		</table>
	</div>
	
	<div class="MainDiv">
		<div class="RowDiv RowBoldBorder">
			<div class="LeftDiv">
				<div class="NewsHeadLineDiv">
					<img alt="新闻头条相关图片" src="/res/image/t.jpg">
					<div>
						<p><a class="Title" href="">习近平举行仪式欢迎越南国家主席</a></p>
						<br>
						<p>6月19日，国家主席习近平在北京人民大会堂同越南国家主席张晋创举行会谈。会谈前，习近平在人民大会堂东门外广场为张晋创举行欢迎仪式。</p>
					</div>
				</div>
				<div class="NewsDiv" id="id_LeftTopLineNewsDiv"></div>
			</div>
			<div class="RightDiv">
				<div class="NewsSearcherDiv">
					<input type="search"><button>搜索</button>
				</div>
				<div id="id_RightTopLineNewsDiv">
				</div>
				
			</div>
			<script type="text/javascript">
				var newsList = new Array();
				var i = 0;
				<c:forEach items="${newsList}" var="n" varStatus="nStatus">
					<c:if test="${n.type.id == 1 && n.topLine == 1 }">
						newsList[i++] = '<div class="NewsItemDiv"><a href="news_open.action?id=${n.id}" target="_blank">${n.mainTitle}</a></div>';
					</c:if>
				</c:forEach>
				var content = '';
				for(var i = 0 ; i < newsList.length && i < 10; i++){
					content += newsList[i];
				}
				document.getElementById('id_LeftTopLineNewsDiv').innerHTML = content;
				content = '';
				for(var i = 10 ; i < newsList.length && i < 26; i++){
					content += newsList[i];
				}
				document.getElementById('id_RightTopLineNewsDiv').innerHTML = content;
			</script>
		</div>
		
		<script type="text/javascript" src="/res/library/js/flyfox_js_view.js"></script>
			
		<div class="RowDiv">
			<div class="RowLeft">
				<div class="RowTitleDiv RowBoldBorder"><h1>国内新闻</h1></div>
				<div class="RowDiv RowBoldBorder" id="id_NewsRowDiv_0"></div>
				<script type="text/javascript">
					var cp;
					var row = document.getElementById('id_NewsRowDiv_0');
					var content;
					var i = 0;
					var cindex = 0;
					<c:forEach items="${ntContainer.newsType3}" var="t" varStatus="tStatus">
						<c:if test="${tStatus.index mod 3 == 0 }">
							<c:choose> 
								<c:when test="${tStatus.index mod 6 == 0 }">
									cp = new CardPane('id_CardPane_' + i,'OneTypeNewsGroup','TypeButtonBar',0);
								</c:when>
								<c:otherwise>
									cp = new CardPane('id_CardPane_' + i,'OneTypeNewsGroupRight','TypeButtonBar',0);
								</c:otherwise>
							</c:choose>
							i++;
							cindex = 0;
							row.appendChild(cp.div);
						</c:if>
						content = "";
						<c:forEach items="${newsList}" var="n" varStatus="nStatus">
							<c:if test="${n.topLine == 0 && n.type.id == 1 && n.type2.id == 4 && n.type3.id == t.id}">
								content += '<li>'
							    + '<a href="news_open.action?id=${n.id}" target="_blank">'
							    + '${n.mainTitle}</a></li>';
							</c:if>
						</c:forEach>
						if(content != ""){
							cp.addCard(cindex, 'NewsGroupPane', '${t.content}', 'TypeButton', content);
							cindex++;
						}
					</c:forEach>
					
							
					content = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img class="NewsImage" src="/res/image/head.jpg"/></a></c:forEach>';	
					c = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img class="NewsImage" src="/res/image/h.jpg"/></a></c:forEach>';
					ct = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img class="NewsImage" src="/res/image/i.jpg"/></a></c:forEach>';
					var cp = new CardPane('id_CardPane_','OneTypeNewsGroupRight','TypeButtonBar',
						0,'<div class="NewsGroupTitle">视频</div>',1);
					cp.addCard(0, 'NewsGroupPane', '旅游', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '港澳', 'TypeButton', c);
					cp.addCard(2, 'NewsGroupPane', '台湾', 'TypeButton', ct);
					row.appendChild(cp.div);
				</script>
				
				<div class="RowTitleDiv RowBoldBorder"><h1>国际新闻</h1></div>
				<div class="RowDiv RowBoldBorder" id="id_NewsRowDiv_1"></div>
				
				<script type="text/javascript">
					var content = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus">'
						+ '<c:if test="${n.type2.id==5}"><li>'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '${n.mainTitle}</a></li></c:if></c:forEach>';
					var cp = new CardPane('id_CardPane_','OneTypeNewsGroup','TypeButtonBar',0);
					cp.addCard(0, 'NewsGroupPane', '国外', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '美国', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '日本', 'TypeButton', content);
					cp.addCard(3, 'NewsGroupPane', '周边', 'TypeButton', content);
					var row = document.getElementById('id_NewsRowDiv_1');
					row.appendChild(cp.div);
					
					cp = new CardPane('id_CardPane_','OneTypeNewsGroupRight','TypeButtonBar',0);
					cp.addCard(0, 'NewsGroupPane', '国外', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '美国', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '日本', 'TypeButton', content);
					cp.addCard(3, 'NewsGroupPane', '周边', 'TypeButton', content);
					row = document.getElementById('id_NewsRowDiv_1');
					row.appendChild(cp.div);
					
					cp = new CardPane('id_CardPane_','OneTypeNewsGroup','TypeButtonBar',0);
					cp.addCard(0, 'NewsGroupPane', '国外', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '美国', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '日本', 'TypeButton', content);
					cp.addCard(3, 'NewsGroupPane', '周边', 'TypeButton', content);
					row = document.getElementById('id_NewsRowDiv_1');
					row.appendChild(cp.div);
					
					cp = new CardPane('id_CardPane_','OneTypeNewsGroupRight','TypeButtonBar',0);
					cp.addCard(0, 'NewsGroupPane', '国外', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '美国', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '日本', 'TypeButton', content);
					cp.addCard(3, 'NewsGroupPane', '周边', 'TypeButton', content);
					row = document.getElementById('id_NewsRowDiv_1');
					row.appendChild(cp.div);
					
				</script>
			</div>
			<div class="RowRight">
				<div class="RowDiv" id="id_ImageNewsRowDiv_0"></div>
				
				<script type="text/javascript">
					var content = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img class="NewsImage" src="/res/image/head.jpg"/></a></c:forEach>';
					var cp = new CardPane('id_CardPane_','ImageNewsGroup','TypeButtonBar',
						0,'<div class="NewsGroupTitle">图片</div>',1);
					cp.addCard(0, 'NewsGroupPane', '旅游', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '港澳', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '台湾', 'TypeButton', content);
					var row = document.getElementById('id_ImageNewsRowDiv_0');
					row.appendChild(cp.div);
				</script>
				<div class="RowDiv" id="id_ImageNewsRowDiv_1"></div>
				
				<script type="text/javascript">
					var content = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img class="NewsImage" src=""/></a></c:forEach>';
					var cp = new CardPane('id_CardPane_','ImageNewsGroup','TypeButtonBar',
						0,'<div class="NewsGroupTitle">图片</div>',1);
					cp.addCard(0, 'NewsGroupPane', '旅游', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '港澳', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '台湾', 'TypeButton', content);
					var row = document.getElementById('id_ImageNewsRowDiv_1');
					row.appendChild(cp.div);
				</script>
			</div>
		</div>
		
		<div class="RowDiv RowBoldBorder">
			<div class="RowLeft">
				<div class="RowDiv" id="id_ImageNewsListDiv_0"></div>
				
				<script type="text/javascript">
					var content = 
						'<c:forEach items="${newsList}" var="n" varStatus="nStatus" begin="0" end="9"><li class="ImageNewsListItem">'
					    + '<a href="news_open.action?id=${n.id}" target="_blank">'
					    + '<img style="width:50px;height:50px; margin-right:5px;" src=""/>'
					    + '${n.mainTitle}</a></li></c:forEach>';
					var cp = new CardPane('id_CardPane_','OneTypeNewsGroupAuto','TypeButtonBar',0);
					cp.addCard(0, 'NewsGroupPane', '国内', 'TypeButton', content);
					cp.addCard(1, 'NewsGroupPane', '港澳', 'TypeButton', content);
					cp.addCard(2, 'NewsGroupPane', '台湾', 'TypeButton', content);
					var row = document.getElementById('id_ImageNewsListDiv_0');
					row.appendChild(cp.div);
				</script>
			</div>
		</div>
	</div>
	<jsp:include page="/page/common/footer.jsp" ></jsp:include>
</body>
</html>
